<?php
session_start(); 
header("Refresh: 120;");
error_reporting(0);
if($_SESSION['userName'] !='admin'){
header( 'location: ../index.php;' ); 
}
	include("../conf/connect.php");	
	
	$gid = $_GET['id'];
	$ghid = $_GET['hid'];
	
	$sql_user = "SELECT * FROM user WHERE name='$gid'";
	$result1=mysql_query($sql_user);
	$head1=mysql_fetch_array($result1, MYSQL_ASSOC);
	
	$Sid = $head1['id'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="../style.css" media="screen" />
	<link rel="shortcut icon" href="images/favicon.ico" />
</head>
<body class="iub_back">
	
	<div>Home | <a href="ihhinfo.php?id=<?php echo $Sid;?>&hid=<?php echo $ghid;?>">HouseHold Info</a> | Adult Info | Search</div>
	<div> Adult information(education_question):</div>
	<table align="center" class="table_border" style="width:1024px;background-color:#0099CC;color:#FFFFFF;">
		<tr style="color:#000000;">
	<?php
	$sql ="SELECT * FROM education where hid= '$ghid' and is_delete=0";
	$result=mysql_query($sql);
	$head=mysql_fetch_array($result, MYSQL_ASSOC);
	$i=o;
	$keysq = array_keys($head); 
	/*echo "<pre>";	
	print_r($keysq);*/
	foreach($keysq as $key){
	?>
		
			<td><?php echo $key;?></td>
	<?php
	$i++;
	}?>
		</tr>
		<?php
			$sql ="SELECT * FROM education where hid= '$ghid' and is_delete=0";
			$result=mysql_query($sql);
			$k=1;
			while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
				if($k%2==0)
					echo "<tr bgcolor='#999999'>";
				else
					echo "<tr bgcolor='#333333'>";
				foreach ($row as $key => $value) {
					//echo "Key: $key; Value: $value<br />\n";
				
		?>
							<td><?php echo $value;?></td>
		<?php   }
				echo "</tr>";
				$k++;
		    }
		?>
			
	</table>
	<div> Adult information(adult_question):</div>
	<table align="center" class="table_border" style="width:1024px;background-color:#0099CC;color:#FFFFFF;">
		<tr style="color:#000000;">
	<?php
	$sql ="SELECT * FROM adult_question where hid= '$ghid' and is_delete=0";
	$result=mysql_query($sql);
	$head=mysql_fetch_array($result, MYSQL_ASSOC);
	$i=o;
	$keysq = array_keys($head); 
	/*echo "<pre>";	
	print_r($keysq);*/
	foreach($keysq as $key){
	?>
		
			<td><?php echo $key;?></td>
	<?php
	$i++;
	}?>
		</tr>
		<?php
			$sql ="SELECT * FROM adult_question where hid= '$ghid' and is_delete=0";
			$result=mysql_query($sql);
			$k=1;
			while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
				if($k%2==0)
					echo "<tr bgcolor='#999999'>";
				else
					echo "<tr bgcolor='#333333'>";
				foreach ($row as $key => $value) {
					//echo "Key: $key; Value: $value<br />\n";
				
		?>
							<td><?php echo $value;?></td>
		<?php   }
				echo "</tr>";
				$k++;
		    }
		?>
			
	</table>
	<div> Adult information(chronic):</div>
	<table align="center" class="table_border" style="width:1024px;background-color:#0099CC;color:#FFFFFF;">
		<tr style="color:#000000;">
	<?php
	$sql ="SELECT * FROM chronic where hid= '$ghid' and  is_delete=0";
	$result=mysql_query($sql);
	$head=mysql_fetch_array($result, MYSQL_ASSOC);
	$i=o;
	$keysq = array_keys($head); 
	/*echo "<pre>";	
	print_r($keysq);*/
	foreach($keysq as $key){
	?>
		
			<td><?php echo $key;?></td>
	<?php
	$i++;
	}?>
		</tr>
		<?php
			$sql ="SELECT * FROM chronic where hid= '$ghid' and  is_delete=0";
			$result=mysql_query($sql);
			$k=1;
			while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
				if($k%2==0)
					echo "<tr bgcolor='#999999'>";
				else
					echo "<tr bgcolor='#333333'>";
				foreach ($row as $key => $value) {
					//echo "Key: $key; Value: $value<br />\n";
				
		?>
							<td><?php echo $value;?></td>
		<?php   }
				echo "</tr>";
				$k++;
		    }
		?>
			
	</table>
	
	<div> Adult information(marital1):</div>
	<table align="center" class="table_border" style="width:1024px;background-color:#0099CC;color:#FFFFFF;">
		<tr style="color:#000000;">
	<?php
	$sql ="SELECT * FROM marital1 where hid= '$ghid' and is_delete=0";
	$result=mysql_query($sql);
	$head=mysql_fetch_array($result, MYSQL_ASSOC);
	$i=o;
	$keysq = array_keys($head); 
	/*echo "<pre>";	
	print_r($keysq);*/
	foreach($keysq as $key){
	?>
		
			<td><?php echo $key;?></td>
	<?php
	$i++;
	}?>
		</tr>
		<?php
			$sql ="SELECT * FROM marital1 where hid= '$ghid' and is_delete=0";
			$result=mysql_query($sql);
			$k=1;
			while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
				if($k%2==0)
					echo "<tr bgcolor='#999999'>";
				else
					echo "<tr bgcolor='#333333'>";
				foreach ($row as $key => $value) {
					//echo "Key: $key; Value: $value<br />\n";
				
		?>
							<td><?php echo $value;?></td>
		<?php   }
				echo "</tr>";
				$k++;
		    }
		?>
			
	</table>
	
	<div> Adult information(marital2):</div>
	<table align="center" class="table_border" style="width:1024px;background-color:#0099CC;color:#FFFFFF;">
		<tr style="color:#000000;">
	<?php
	$sql ="SELECT * FROM marital2 where hid= '$ghid' and is_delete=0";
	$result=mysql_query($sql);
	$head=mysql_fetch_array($result, MYSQL_ASSOC);
	$i=o;
	$keysq = array_keys($head); 
	/*echo "<pre>";	
	print_r($keysq);*/
	foreach($keysq as $key){
	?>
		
			<td><?php echo $key;?></td>
	<?php
	$i++;
	}?>
		</tr>
		<?php
			$sql ="SELECT * FROM marital2 where hid= '$ghid' and is_delete=0";
			$result=mysql_query($sql);
			$k=1;
			while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
				if($k%2==0)
					echo "<tr bgcolor='#999999'>";
				else
					echo "<tr bgcolor='#333333'>";
				foreach ($row as $key => $value) {
					//echo "Key: $key; Value: $value<br />\n";
				
		?>
							<td><?php echo $value;?></td>
		<?php   }
				echo "</tr>";
				$k++;
		    }
		?>
			
	</table>
	
	<div> Adult information(acute):</div>
	<table align="center" class="table_border" style="width:1024px;background-color:#0099CC;color:#FFFFFF;">
		<tr style="color:#000000;">
	<?php
	$sql ="SELECT * FROM acute where hid= '$ghid' and is_delete=0";
	$result=mysql_query($sql);
	$head=mysql_fetch_array($result, MYSQL_ASSOC);
	$i=o;
	$keysq = array_keys($head); 
	/*echo "<pre>";	
	print_r($keysq);*/
	foreach($keysq as $key){
	?>
		
			<td><?php echo $key;?></td>
	<?php
	$i++;
	}?>
		</tr>
		<?php
			$sql ="SELECT * FROM acute where hid= '$ghid' and is_delete=0";
			$result=mysql_query($sql);
			$k=1;
			while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
				if($k%2==0)
					echo "<tr bgcolor='#999999'>";
				else
					echo "<tr bgcolor='#333333'>";
				foreach ($row as $key => $value) {
					//echo "Key: $key; Value: $value<br />\n";
				
		?>
							<td><?php echo $value;?></td>
		<?php   }
				echo "</tr>";
				$k++;
		    }
		?>
			
	</table>
	
	<div> Adult information(med1):</div>
	<table align="center" class="table_border" style="width:1024px;background-color:#0099CC;color:#FFFFFF;">
		<tr style="color:#000000;">
	<?php
	$sql ="SELECT * FROM med1 where hid= '$ghid' and  is_delete=0";
	$result=mysql_query($sql);
	$head=mysql_fetch_array($result, MYSQL_ASSOC);
	$i=o;
	$keysq = array_keys($head); 
	/*echo "<pre>";	
	print_r($keysq);*/
	foreach($keysq as $key){
	?>
		
			<td><?php echo $key;?></td>
	<?php
	$i++;
	}?>
		</tr>
		<?php
			$sql ="SELECT * FROM med1 where hid= '$ghid' and is_delete=0";
			$result=mysql_query($sql);
			$k=1;
			while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
				if($k%2==0)
					echo "<tr bgcolor='#999999'>";
				else
					echo "<tr bgcolor='#333333'>";
				foreach ($row as $key => $value) {
					//echo "Key: $key; Value: $value<br />\n";
				
		?>
							<td><?php echo $value;?></td>
		<?php   }
				echo "</tr>";
				$k++;
		    }
		?>
			
	</table>
	
	<div> Adult information(med2):</div>
	<table align="center" class="table_border" style="width:1024px;background-color:#0099CC;color:#FFFFFF;">
		<tr style="color:#000000;">
	<?php
	$sql ="SELECT * FROM med2 where hid= '$ghid' and is_delete=0";
	$result=mysql_query($sql);
	$head=mysql_fetch_array($result, MYSQL_ASSOC);
	$i=o;
	$keysq = array_keys($head); 
	/*echo "<pre>";	
	print_r($keysq);*/
	foreach($keysq as $key){
	?>
		
			<td><?php echo $key;?></td>
	<?php
	$i++;
	}?>
		</tr>
		<?php
			$sql ="SELECT * FROM med2 where hid= '$ghid' and is_delete=0";
			$result=mysql_query($sql);
			$k=1;
			while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
				if($k%2==0)
					echo "<tr bgcolor='#999999'>";
				else
					echo "<tr bgcolor='#333333'>";
				foreach ($row as $key => $value) {
					//echo "Key: $key; Value: $value<br />\n";
				
		?>
							<td><?php echo $value;?></td>
		<?php   }
				echo "</tr>";
				$k++;
		    }
		?>
			
	</table>
</body>
</html>